← Back to issue list

Crash when key in snap/keys is not ascii armored

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1918998
Type
issue
State
open
Author
~racb
Labels
Created
2021-03-13 00:09:33.173307+00:00
Updated
2021-03-18 13:13:05.042539+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

If I put a key in snap/keys/ that is not ascii armored (ie. it's a binary file), snapcraft crashes with: Sorry, an error occurred in Snapcraft: 'utf-8' codec can't decode byte 0x98 in position 0: invalid start byte This is with --enable-experimental-package-repositories and: package-repositories: - type: apt url: file:///home/ubuntu/repo path: . key-id: EE2C5601BCD68938A8A04B9FE257B677BFDF724C and a file called snap/keys/EE2C5601.asc. Expected: a suitable error message. Actual: a crash. Solution: gpg -a --export BFDF724C > snap/keys/EE2C5601.asc In other words, ensure that the file is actually ASCII. The workaround is easy, but there's an opportunity for better handling of this; hence this report.

Evaluation history

No evaluation history available.